package org.dylan.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import java.net.InetAddress;

/**
 * 项目初始化提示内容
 *
 * @author Dylan
 * @since 2024-10-24
 */
@Component
public class AppInitConfig implements CommandLineRunner {

    @Value("${server.port}")
    private String port;

    @Override
    public void run(String... args) throws Exception {
        System.out.println(">>>>>>>>>>>>>>> UniApp H5 页面生成工具 <<<<<<<<<<<<<");
        String ip = InetAddress.getLocalHost().getHostAddress();
        System.out.println("项目相关信息:\n\t" +
                "- 本都地址: http://localhost:" + port + "/\n\t" +
                "- 网络地址: http://" + ip + ":" + port + "/\n\t" +
                "- 接口文档: http://" + ip + ":" + port + "/doc.html\n" +
                ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
    }
}
